<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css/style.css" rel="stylesheet" type="text/css" />
<title>ADM002 Page</title>
</head>
<body>
<f:view beforePhase="#{listUserManaged.initPage}">
	<!-- Begin vung header -->
	<jsp:include page="header.jsp"></jsp:include>
	<!-- End vung header -->
	<!-- Begin vung dieu kien tim kiem -->
	<h:form>
		<table class="tbl_input" border="0" width="90%" cellpadding="0"
			cellspacing="0">
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td>会員名称で会員を検索します。検索条件無しの場合は全て表示されます。</td>
			</tr>
			<tr>
				<td width="100%">
				<table class="tbl_input" cellpadding="4" cellspacing="0">
					<tr>
						<td class="lbl_left">氏名:</td>
						<td align="left"><h:inputText
							value="#{listUserManaged.fullName}" styleClass="txBox" size="20"
							onfocus="this.style.borderColor='#0066ff';"
							onblur="this.style.borderColor='#aaaaaa';">
						</h:inputText></td>
						<td></td>
					</tr>
					<tr>
						<td class="lbl_left">グループ:</td>
						<td align="left" width="80px"><h:selectOneListbox size="1"
							value="#{listUserManaged.groupId}">
							<f:selectItems value="#{listUserManaged.itemGroups}" />
						</h:selectOneListbox> <t:saveState value="#{listUserManaged.itemGroups}" /></td>
						<td align="left"><h:commandButton styleClass="btn" value="検索"
							action="#{listUserManaged.doSearch}"></h:commandButton>&nbsp; <h:commandButton
							styleClass="btn" value="新規追加" action="#{userManaged.doRegist}"></h:commandButton></td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		<!-- End vung dieu kien tim kiem -->
		<!-- Begin vung hien thi danh sach user -->
		<c:if test="${listUserManaged.tag}">
			<table class="tbl_list" border="1" cellpadding="4" cellspacing="0"
				width="80%">
				<tr class="tr2">
					<th align="center" width="20px">ID</th>
					<th align="left">氏名 <c:if
						test="${listUserManaged.sortByFullName == 'ASC'}">
						<h:commandLink value="▲▽" action="#{listUserManaged.doSort}">
							<f:param name="sortByFullName" value="DESC" />
							<f:param name="sortType" value="sortByFullName"></f:param>
						</h:commandLink>
					</c:if> <c:if test="${listUserManaged.sortByFullName == 'DESC'}">
						<h:commandLink value="△▼ " action="#{listUserManaged.doSort}">
							<f:param name="sortByFullName" value="ASC" />
							<f:param name="sortType" value="sortByFullName"></f:param>
						</h:commandLink>
					</c:if></th>
					<th align="left">生年月日</th>
					<th align="left">グループ</th>
					<th align="left">メールアドレス</th>
					<th align="left" width="70px">電話番号</th>
					<th align="left">日本語能力 <c:if
						test="${listUserManaged.sortByCodeLevel == 'ASC'}">
						<h:commandLink value="▲▽" action="#{listUserManaged.doSort}">
							<f:param name="sortByCodeLevel" value="DESC" />
							<f:param name="sortType" value="sortByCodeLevel"></f:param>
						</h:commandLink>
					</c:if> <c:if test="${listUserManaged.sortByCodeLevel == 'DESC'}">
						<h:commandLink value="△▼ " action="#{listUserManaged.doSort}">
							<f:param name="sortByCodeLevel" value="ASC" />
							<f:param name="sortType" value="sortByCodeLevel"></f:param>
						</h:commandLink>
					</c:if></th>
					<th align="left">失効日 <c:if
						test="${listUserManaged.sortByEndDate == 'DESC'}">
						<h:commandLink value="△▼ " action="#{listUserManaged.doSort}">
							<f:param name="sortByEndDate" value="ASC" />
							<f:param name="sortType" value="sortByEndDate"></f:param>
						</h:commandLink>
					</c:if> <c:if test="${listUserManaged.sortByEndDate == 'ASC'}">
						<h:commandLink value="▼ △" action="#{listUserManaged.doSort}">
							<f:param name="sortByEndDate" value="DESC" />
							<f:param name="sortType" value="sortByEndDate"></f:param>
						</h:commandLink>
					</c:if></th>
					<th align="left">点数</th>
				</tr>
				<t:dataList value="#{listUserManaged.lsUserDetailDto}" var="item">
					<tr>
						<td><h:outputText value="#{item.userId}"></h:outputText></td>
						<td><h:outputText value="#{item.fullName}"></h:outputText></td>
						<td><h:outputText value="#{item.birthDay}">
						</h:outputText></td>
						<td><h:outputText value="#{item.groupName}"></h:outputText></td>
						<td><h:outputText value="#{item.email}"></h:outputText></td>
						<td><h:outputText value="#{item.tel}"></h:outputText></td>
						<td><h:outputText value="#{item.nameLevel}"></h:outputText></td>
						<td><h:outputText value="#{item.endDate}">
							<f:convertDateTime type="date" pattern="dd/MM/yyyy" />
						</h:outputText></td>
						<td><h:outputText value="#{item.total}"></h:outputText></td>
					</tr>
				</t:dataList>
				<t:saveState value="#{listUserManaged.lsUserDetailDto}" />
			</table>

			<!-- Begin vung paging -->
			<table>
				<tr>
					<!--<td class="lbl_paging"><a href="#">1</a> &nbsp;<a href="#">2</a>
					&nbsp;<a href="#">3</a>&nbsp;<a href="#">>></a></td>-->

					<td class="lbl_paging"><t:dataList
						value="#{listUserManaged.lsPaging}" var="item">
						<h:commandLink value="#{item}"
							action="#{listUserManaged.doPaging}">
							<f:param name="currentPage" value="#{item}"></f:param>
						</h:commandLink>
					</t:dataList></td>
				</tr>
			</table>
			<!-- End vung paging -->
		</c:if>
		<c:if test="${!listUserManaged.tag}">
			<h:outputText value="#{listUserManaged.message}" styleClass="errMsg" />
		</c:if>
		<!-- End vung hien thi danh sach user -->

		<jsp:include page="footer.jsp"></jsp:include>
		<!-- End vung footer -->
	</h:form>
</f:view>
</body>
</html>